package cn.xspace.wnx.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;

/**
 * Created by liuchen on 2016/11/21.
 */

public class PreferencesDb {
    private Context context;
    private static PreferencesDb instance;
    public static final String TABLE_NAME = "Preferences";

    public static String key = "key";
    public static String value = "value";
    private SQLiteDatabase sqldb;

    public static PreferencesDb getInstance() {
        if (instance == null) {
            instance = new PreferencesDb();
        }
        return instance;
    }

    public static String CREATE_TABLE = "CREATE TABLE " + TABLE_NAME
            + " (" + key
            + " text," + value + " text);";

    private PreferencesDb() {

    }

    public void savePreferences(String key, String value) {
        WNXDBManager.getInstance().savePreferences(key, value);
    }

    public String queryPreferences(String key) {
        return WNXDBManager.getInstance().queryPreferences(key);
    }


}
